<?php
if(!defined('InEmpireCMS'))
{
	exit();
}
?>
<?php
//查询SQL，如果要显示自定义字段记得在SQL里增加查询字段
$query="select id,classid,titleurl,groupid,newspath,filename,checked,isqf,havehtml,istop,isgood,firsttitle,ismember,username,plnum,totaldown,onclick,newstime,truetime,lastdotime,titlefont,titlepic,title from {$dbtbpre}ecms_".$mr['tbname']." where ".$yhadd."userid='$user[userid]' and ismember=1".$add." order by newstime desc limit $offset,$line";
$sql=$empire->query($query);

$url="<a href='../../'>首页</a>&nbsp;>&nbsp;<a href='../member/cp/'>控制面板</a>&nbsp;>&nbsp;<a href='ListInfo.php?mid=$mid'>管理信息</a>&nbsp;(".$mr[qmname].")";
require(ECMS_PATH.'e/data/template/cp_1.php');
?>
<div class="dmain_conent">
	<div class="pageindex">
	</div>
	<div class='dmini-content'>		
<style>
.list_table{background:#fff;margin:0px 0px;width:100%}
.list_table thead tr{background:#eee;}
</style>
	<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="list_table">
	<thead>
		 <tr class="header"> 
			<th width="50%" height="25"> <div align="center">标题</div></th>
			<th width="8%" height="25"> <div align="center">点击</div></td>
			<th width="13%" height="25"> <div align="center">发布时间</div></th>
			<th width="6%"><div align="center">评论</div></th>
			<th width="6%"><div align="center">审核</div></th>
			<th width="17%" height="25"><div align="center">操作</div></th>
		</tr>
	</thead>
	<tbody>
		  <?
			while($r=$empire->fetch($sql)){
				//状态
				$is_list=true;
				$st='';
				if($r[istop])//置顶
				{
					$st.="<font color=red>[顶".$r[istop]."]</font>";
				}
				if($r[isgood])//推荐
				{
					$st.="<font color=red>[推]</font>";
				}
				if($r[firsttitle])//头条
				{
					$st.="<font color=red>[头]</font>";
				}
				//时间
				$newstime=date("Y-m-d",$r[newstime]);
				$oldtitle=$r[title];
				$r[title]=stripSlashes(sub($r[title],0,50,false));
				$r[title]=DoTitleFont($r[titlefont],$r[title]);
				if(empty($r[checked]))
				{$checked="<font color=red>×</font>";}
				else
				{$checked="√";}
				$plnum=$r[plnum];//评论个数
				//$titleurl=sys_ReturnBqTitleLink($r);//链接
				//标题图片
				$showtitlepic="";
				if($r[titlepic])
				{$showtitlepic="<a href='".$r[titlepic]."' title='预览标题图片' target=_blank><img src='../data/images/showimg.gif' border=0></a>";}
				//栏目
				$classname=$class_r[$r[classid]][classname];
				$classurl=sys_ReturnBqClassname($r,9);
				$bclassid=$class_r[$r[classid]][bclassid];
				$br['classid']=$bclassid;
				$bclassurl=sys_ReturnBqClassname($br,9);
				$bclassname=$class_r[$bclassid][classname];
			?>
		  <tr bgcolor="#FFFFFF" id=news<?=$r[id]?>> 
			<td height="25"> <div align="left"> 
				<?=$st?><?=$r[titlepic]?"<img src='{$r[titlepic]}' height='20'/>":""?>
				<a href="<?=$titleurl?>" target=_blank title="<?=$oldtitle?>"> 
				<strong><?=$r[title]?></strong>
				</a>			  
			  </div></td>
			<td height="25"> <div align="center"> <a title="下载次数:<?=$r[totaldown]?>"> 
				<?=$r[onclick]?>
				</a> </div></td>
			<td height="25"> <div align="center"><?=$newstime?></div></td>
			<td><div align="center"><a href="../pl/?id=<?=$r[id]?>&classid=<?=$r[classid]?>" title="查看评论" target=_blank><u> 
				<?=$plnum?>
				</u></a></div></td>
			<td><div align="center">
				<?=$checked?>
			  </div></td>
			<td height="25"> <div align="center">[<a href="../i/?e=<?=$r[classid]?>&id=<?=$r[id]?>">修改</a>] 
				[<a href="../i/ecms.php?enews=MDelInfo&classid=<?=$r[classid]?>&id=<?=$r[id]?>&mid=<?=$mid?>" onclick="return confirm('确认要删除?');">删除</a>] 
			  </div></td>
		  </tr>
		  <?
			}
				if(!$is_list){echo '<tr><td colspan="6"><div class="no-data">暂无数据！</div></td></tr>';}
			?>
		
			  <tr><td colspan='6'><?=$returnpage?></td></tr>
		
</table>
	</div>
</div>
<?php
require(ECMS_PATH.'e/data/template/cp_2.php');
?>